﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Interface;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "客户端";
            //using (ChannelFactory<IHelloworld> channelFactory = new ChannelFactory<IHelloworld>("helloworld"))
            //{
            //    IHelloworld proxy = channelFactory.CreateChannel();
            //    using (proxy as IDisposable)
            //    {
            //        var result = proxy.SayHally("World");
            //        Console.WriteLine(result);
            //        Console.ReadKey();
            //    }
            //}
            var helloService = ServiceLocator.Create<IHelloworld>("helloworld");
            var result = helloService.SayHally("World");
            Console.WriteLine(result);
            Console.ReadKey();
        }
    }
}
